
cmake_minimum_required(VERSION 3.5.1)

project(a2d LANGUAGES CXX VERSION 0.7)

include(cmake/SparkEnvConfig.cmake)
include(cmake/SparkMacrosConfig.cmake)
include(cmake/SparkFindLibraries.cmake)
include(cmake/SparkFindQt5Config.cmake)
include(cmake/SparkFindQt6Config.cmake)
include(cmake/SparkFindDtkConfig.cmake)

# 资源文件路径
set(QRC_SOURCES "")

spark_add_executable_path(${PROJECT_NAME} src
    ${QRC_SOURCES}
)
target_link_dtk(${PROJECT_NAME})
target_link_qt5(${PROJECT_NAME})
target_link_qt5_concurrent(${PROJECT_NAME})
target_link_qt5_svg(${PROJECT_NAME})


include(cmake/SparkBuildGraphviz.cmake)

include(cmake/SparkDesktopMacros.cmake)
spark_desktop_macros(
    "a2d"
    "a2d软件包转化工具"
    "轻松的将Appimage软件转化为deb格式,便于安装使用和分发。"
    "Application"
    "a2d"
    "a2d"
    "Utility"
)
install(FILES ${CMAKE_BINARY_DIR}/${APP_NAME}.desktop
    DESTINATION /usr/share/applications
)
install(TARGETS ${APP_NAME}
    DESTINATION /usr/bin
)
install(FILES assets/a2d.svg
    DESTINATION /usr/share/icons/hicolor/scalable/apps
)

find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/package-deb.descript)